package obsolet;


import info.bliki.api.Connector;
import info.bliki.api.User;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;

import org.xml.sax.SAXException;

public class SecondClass {
     

        public static void testQueryLangLinks() {
                User user = new User("", "", "http://en.wikipedia.org/w/api.php");
                user.login();
                String[] valuePairs = { "prop", "langlinks", "titles", "England" };
                Connector connector = new Connector();
                String rawXmlResponse = connector.queryXML(user, valuePairs);
                if (rawXmlResponse == null) {
                        System.out.println("Got no XML result for the query");
                }
                System.out.println(rawXmlResponse);

                // When more results are available, use "llcontinue" from last query result
                // to continue
                String[] valuePairs2 = { "prop", "langlinks", "titles", "England", "llcontinue", "9316|bar" };

                rawXmlResponse = connector.queryXML(user, valuePairs2);
                if (rawXmlResponse == null) {
                        System.out.println("Got no XML result for the query");
                }
                System.out.println(rawXmlResponse);

        }

        public static void main(String[] args) {
                testQueryLangLinks();
        }
}